Announcement

Collapse
No announcement yet.

{The List} AI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by skywalker
    If it doesn't use a heuristic, and doesn't use a neural net, wouldn't that mean either a) it moved randomly
    Not necesarily... you could use predetermined actions, without evaluating your circumstances... this could get ridiculous if it happened at a low level, though.. like a settler trying to move into the ocean, because the AI *ALWAYS* builds one, and moves the first one 5 north, then settles with it.

    or b) it created a tree of all possible moves and evaluated them?
    Yep... typically minmax trees. The decision space is effectively infinite in terms of a Civ game, though.

    A fuzzy logic (as opposed to crisp logic) system can (and has) been used, as well as heuristics, and neural nets (not sure how successful neural net efforts have been in Civ.)

    Comment


    • #47
      Originally posted by MrBaggins
      Heuristics essentially means evaluating and reacting to feedback. E.G. Defending when attacked, stoping production of settlers when there's nowhere to settle, etc.

      Any AI worthy of being called an AI does this.
      From "The Handbook of Artificial Intelligence" (Barr and Feigenbaum, Vol 1):

      ...a brief review [of how "heuristic" is used] may serve as a useful warning against taking any single definition seriously.
      Nah, I'm not gonna type all this in. Suffice to say that your definition of "heuristic" is one of the earliest ones but a lot more shallow than what I mean.

      Yes, the AI reacts to the current state of the game.

      I think it would be cool if it based its strategies on a recall of all the previous moves of the game.

      And cooler still if it based its strategies on recall of all previous games played.

      That's what I'm getting at. Prohibitively expensive, probably, though you could fruitfully reduce strategies down over time, so that you weren't storing every game with every move forever.

      [ok]
      [ok]

      "I used to eat a lot of natural foods until I learned that most people die of natural causes. "

      Comment


      • #48
        It might be "cool" but the descision space doesn't lend itself to it:

        Whilst in a limited context you might be able to use an adaptive (typically genetic) solution, you are essentially limited to building, tech choices, and perhaps worker behavior. Since the value of these choices differ hugely, depending on situation, and opposition, you won't always get reliable data, and then you come to the problem of defining the context... storing the original world.

        A solution to this might be a repository of MP games and their actions, but the sample size is massive, and with an adaptive algorithm you need to determine relative success and failure... its difficult to determine slight differences in success and failure... and tough to know whether they are due to situation or ineffective tactics, strategy, or just bad rolls.

        The sample size of an AI within a single game is insignificant. It would be pointless for an AI to try to improve within a game, since it would be effectively out of context.

        Since there are a variable number of entities, you'd need to develop some extensible adaptable system... forget a static genetic solution... and store and crunch massive volumes of data.

        Any current traditional adaptive solutions are inapplicable to a general Civ AI (although possible for tech, or worker use)

        Comment


        • #49
          I've posted a response to ths twice. It's vanished both times.... What gives?
          [ok]

          "I used to eat a lot of natural foods until I learned that most people die of natural causes. "

          Comment


          • #50
            Originally posted by MrBaggins
            It might be "cool" but the descision space doesn't lend itself to it:

            Whilst in a limited context you might be able to use an adaptive (typically genetic) solution, you are essentially limited to building, tech choices, and perhaps worker behavior. Since the value of these choices differ hugely, depending on situation, and opposition, you won't always get reliable data, and then you come to the problem of defining the context... storing the original world.

            A solution to this might be a repository of MP games and their actions, but the sample size is massive, and with an adaptive algorithm you need to determine relative success and failure... its difficult to determine slight differences in success and failure... and tough to know whether they are due to situation or ineffective tactics, strategy, or just bad rolls.

            The sample size of an AI within a single game is insignificant. It would be pointless for an AI to try to improve within a game, since it would be effectively out of context.

            Since there are a variable number of entities, you'd need to develop some extensible adaptable system... forget a static genetic solution... and store and crunch massive volumes of data.

            Any current traditional adaptive solutions are inapplicable to a general Civ AI (although possible for tech, or worker use)
            Would it be possible to take a genetic algorithm, have it play a whole lot of games, and then just use the resulting AI as the AI for the game (so it doesn't evolve further)?

            Comment


            • #51
              Maybe... assuming you could get a sufficient sample size (probably not) and encode the data (GA's are just the typical form of EA, which have shown most success, but have limited capacity to define an expanding situation, such as a civ game.) NN's are extensible and so are the current solution to a non-finite system such as Civ.

              Here's a snippet from a piece in gamasutra a while back

              Interestingly enough, some developers (roughly 20 percent of attendees) were experimenting with Artificial Neural Networks (ANNs) as a learning technology. ANNs have cropped up often in the AI roundtables as a potential solution to the learning-AI problem, but there are some interesting challenges in using the technology in games that have discouraged most developers to date. Historically, using ANNs within a game presents the developer with two particularly thorny problems: First, it can be very difficult to identify meaningful inputs and match them to outputs that make sense within the context of the game; and second, most ANNs learn through a technique called "supervised learning," which requires constant developer feedback. While it is possible to build ANNs that can learn unsupervised, there's no guarantee that they won't "go stupid" and become completely helpless players.

              Most developers are trying to avoid these problems by training their ANNs exclusively during the development phase, then freezing them before the game actually ships. This allows them to let the AIs learn while playing against the development team and play testers without the risk that a shipping AI might wander off into some Rain Man universe of perception. The downside to this, of course, is that the game doesn't learn anything from the player, and so the whole effort boils down to an automated form of AI tuning (ultimately similar to using genetic algorithm to try to tune various game AI parameters). A developer of an upcoming sports game announced that he was working on a way to integrate unsupervised learning ANNs into his game, although he planned to include an option to reset the AI should the player feel it had become feeble-minded (or too strong a player, as the case may be).

              One big problem with learning AIs that caused much amused discussion at the roundtables was the fact that a learning AI is, by definition, unpredictable. This leads to huge problems when it comes time to do quality assurance testing on your game — how can anything be tested reliably if it behaves differently from game to game? How can a developer fix a bug if it's impossible to recreate the conditions that led to a certain behavior?

              On a closely related vein, several developers noted that they were attempting to find AI technologies that would do a better job at strategic-level thinking and planning. To date, most strategy games do an adequate job at the tactical level — identifying cities or units to attack, taking advantage of unprotected assets, and so on — but do a lousy job at developing and implementing grand strategy. The problem, from a programmer's point of view, is basically one of optimization.

              Most war games (ignoring for the moment most first-person shooters and RPGs, since they are primarily tactical in the extreme), whether real-time strategy or turn-based, do a much better job of optimizing small, tactical situations over larger, strategic ones. This leads to AIs that fight battles well but still manage to lose the war, often because they overlook solutions glaringly obvious to the human player. A large part of this situation is simply the result of the historical inclination of developers to build AIs at the unit level; for example, in a Civil War game, a cavalry unit might decide to attack an artillery unit without the presence of any other support. This in turn leads to an AI that often overlooks obvious attacks in favor of frittering away its forces. Adding in an ability for a unit to call for help balances things out somewhat, but that's still a far cry from strategic-level thinking.

              Additionally, there's the problem that strategic-level planning may be very good for the war effort overall, but very bad for the individual unit. One example of this might be a brigade ordered to hold a vital mountain pass in the face of overwhelming enemy attack — the war might be won because the delaying action bought the time necessary to get reinforcements to the area, but the unit itself isn't likely to survive. An AI built to handle only unit-level thinking is going to have a hard time making this kind of trade-off. Chess game AIs are perhaps the one exception to this rule, but they're cheating, since most chess programs draw upon databases of thousands of games and simply pick the highest-scoring move available at that moment.

              Many developers present felt that the time had come to redress this imbalance and were looking to a number of AI-related technologies for help. Some were building on the same techniques used for learning algorithms by using databases of previously-successful moves to develop plans for similar future moves. Others were looking at tools such as Influence Maps (see sidebar "Influence Maps in a Nutshell") to provide ways for their AIs to "see" the grand strategic picture. A few were hoping simply to solve the problem the same way most chess programs do, which is to build large databases of opening strategic moves based on feedback from play testers and the development team.

              Interestingly enough, a vocal minority of developers felt the move towards developing better strategic AIs was primarily a waste of time, particularly in games in which players can't easily see the other side's forces. The theory they put forth was that if the player can't see what the computer is doing, why waste time on elaborate strategic AIs in the first place? A few well-placed but thoroughly plausible unit placements (via judicious cheating on the part of the AI) would go a long way towards providing the player with an enjoyable gaming experience. Many of this group felt that the mere appearance of a tank deep behind enemy lines would be ascribed a meaning by the player if the attack came at a particularly vulnerable time. They based this opinion on the reams of e-mail they had received from players that raved about the intelligence of the AIs in their games, when the AI was, in fact, cheating outrageously just to keep up.

              Comment


              • #52
                I believe the AI should be rule-based, and importantly should moddable by the community.

                I don't have a lot of faith that at release the AI will be optimal. The reason is that evaluating the AI takes a lot of playtesting, something that game developers never do enough of.

                For this reason, I believe that the AI should definately not exist as hardcoded within the engine, but instead be stored as scripted rules within separate text files. The game Jane's Fleet Command had the ai rules separated out like this into doctrine files. The result is that modders could not only correct flaws in the original AI but could also support mods in other areas.

                All or most the above ideas from other posters could be expressed within these rules. The same scripting language could expose other non-ai elements to the evil hands of modders, such as the interface and informational screens.

                Furthormore, the AI should have hooks to allow these rules to be applied at different levels of evaluation such as national, continental, regional, city and unit. Information flows up from the unit and city level, and commands and methods flow down. For those with some programming experience, I am imagining an object-oriented paradigm that could simulate polymorphism and generalisation.

                The primary point I would wish to impress upon the reader is that the AI should be moddable. The greater ease of customisation, extension and correction, the better.
                Ut sementem feceris ita metes.
                ~ As you sow so will you reap.
                ----Cicero

                Comment


                • #53
                  FWIW, here's my list of what the AI needs to do in a civ-type game to get the breakthrough many of us want. Many of these have been mentioned already above. We're not going to get anything like this out of Civ4 :

                  AI that thinks in 'Levels' about strategy, from very high level down to small details. This is an Hierarchical approach

                  Levels will go from very abstract pictures of the world at high levels, down to pretty accurate copies of the world, for small things

                  Corrections will be made in the higher level AI to incorporate information from the more detailed AI levels below it

                  As much as possible, design the world models in the game so they are easier for the AI to handle

                  Use good rules-of-thumb (heuristics) as a firm base for AI actions

                  As much as possible evolve unique strategies Beyond the heuristics using Genetic Algorithms

                  Test AI strategies as much as possible using Monte Carlo techniques (copy the world as that AI sees it; how does the strategy play out in the copies?)

                  Threaded AI that can take advantage of any time not used by the world model and the interface

                  Allow the player to give the AIs any arbitrary advantages that they deem necessary

                  More details for those who want them are on the Clash of Civilizations AI page.
                  Project Lead for The Clash of Civilizations
                  A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
                  Check it out at the Clash Web Site and Forum right here at Apolyton!

                  Comment


                  • #54
                    Updated! Mark: Could you differentiate between what's new in your post please?
                    Do not fear, for I am with you; Do not anxiously look about you, for I am your God.-Isaiah 41:10
                    I praise you because I am fearfully and wonderfully made - Psalms 139.14a
                    Also active on WePlayCiv.

                    Comment


                    • #55
                      Of course Mark would show uo here.

                      Aboutu rules: You don't need scripted rules to get the ai to work, you need scripted input to the ai.
                      For instance, right now in Clash (well, on my machine, and Mark's), the (military) ai has 2 levels (not yet enough to be called hierarchical, but then...). The highest level can precise a breakdown of various 'attitudes': Which proportion of military resoures should be used for what. This proportion is defined in script. Each attitude, in which the objectives are themselves defined, is defined in a text file. This doesn't require 'rules' to make moddabke ai. Of course, rules or triggers are needed in order to allow specific orders to be given to the ai like 'take city XXX' instead of 'take most promising opponent square'.
                      Tuning of parameters, not even going as far as rules, should be made in script (how much aggressive, how many losses are allowed, what value is given to something or other...).
                      The rules should come from 'if' clauses which are IMO outside the ai but can influence it: An "If capital taken then" trigger can be useful for modders to tune ai (so you would build a new palace for instance) or to cause whatever events a modder may think of.

                      One thing I'd like ai's to consider is the value of techs based on what the civ will do with it rather than on its research value modified by a scripted factor (e.g. military tech = high cost, as in civ or galciv). An ai should put little or no value to a tech which lets it build units that are not better than those it already has (for instance chariots are not a priority for aztecs in civ3, thus wheel tech shouldn't be bought except for its value as a prerequisite for other techs).

                      (edited for clarity - may not be clear enough even with that)
                      Last edited by LDiCesare; January 2, 2004, 13:38.
                      Clash of Civilization team member
                      (a civ-like game whose goal is low micromanagement and good AI)
                      web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)

                      Comment


                      • #56
                        I want to be able to tell one of my units to explore in a general direction or to go to a specific destination but tell it whether to stay out of rival territory.

                        Comment


                        • #57
                          The theory they put forth was that if the player can't see what the computer is doing, why waste time on elaborate strategic AIs in the first place? A few well-placed but thoroughly plausible unit placements (via judicious cheating on the part of the AI) would go a long way towards providing the player with an enjoyable gaming experience





                          I bet there were Brian Reynolds or Sid Meier at that table. This is the way most of their Civ games work. And they work surprisingly well, meaning, I have yet to see an AI that is designed to make only "thought out" decisions and performes significantly better than their (mostly random) AI's. Civ III doesn't count as it was simplified, but GalCiv seems promising in this regard.

                          Comment


                          • #58
                            I just realized I haven't made a spare place for the list in case the original post is getting too long.

                            Done.
                            Do not fear, for I am with you; Do not anxiously look about you, for I am your God.-Isaiah 41:10
                            I praise you because I am fearfully and wonderfully made - Psalms 139.14a
                            Also active on WePlayCiv.

                            Comment


                            • #59
                              Originally posted by MrBaggins
                              Maybe... assuming you could get a sufficient sample size (probably not) and encode the data (GA's are just the typical form of EA, which have shown most success, but have limited capacity to define an expanding situation, such as a civ game.) NN's are extensible and so are the current solution to a non-finite system such as Civ.
                              What the article was saying was basically what I was suggesting - just get a supercomputer or a bunch of desktops and have the AI play itself constantly for, say, a month then freeze the final product and hope the players don't get whupped.

                              Comment


                              • #60
                                and the Easter Bunny and Santa Claus do the QA, right?

                                Comment

                                Working...
                                X